<template>
  <mu-card class="post-item">
    <mu-card-title :title="post.title" :subTitle="getTime(post.published_at)" >
      </mu-card-title>
      <mu-card-media >
      <img :src="post.feature_image" v-if="post.feature_image" />
    </mu-card-media>
  </mu-card> 
</template>
<script>
import moment from 'moment'
export default {
  name: 'post-item',
  props: {
    post: {
      type: Object
    }
  },
  methods: {
    getTime (time) {
      return moment(time).fromNow()
    }
  }
}
</script>
<style scoped>  
.post-item{
  background-color: #FFF;
  margin: 12px 12px 0 12px;
}
</style>
